import request from '@/utils/request'
import da from "element-ui/src/locale/lang/da";

// 查询模板列表
export function listTemplate(query) {
  return request({
    url: '/base/template/list',
    method: 'get',
    params: query
  })
}

// 查询模板详细
export function getTemplate(id) {
  return request({
    url: '/base/template/' + id,
    method: 'get'
  })
}

// 新增模板
export function addTemplate(data) {
  return request({
    url: '/base/template',
    method: 'post',
    data: data
  })
}

// 修改模板
export function updateTemplate(data) {
  return request({
    url: '/base/template',
    method: 'put',
    data: data
  })
}

// 删除模板
export function delTemplate(id) {
  return request({
    url: '/base/template/' + id,
    method: 'delete'
  })
}

// 导出模板
export function exportTemplate(query) {
  return request({
    url: '/base/template/export',
    method: 'get',
    params: query
  })
}

//删除文件
export function deleteTemplateFile(realName) {
  // const data = {
  //   realName: realName
  // }
  return request({
    url: '/base/template/delTemplateFile/' + realName,
    method: "get",
    // params: realName
  })
}
//上传文件
export function uploadTmage(data){
  return request({
    url:'/common/uploadImage',
    method:'post',
    data:data
  })
}
export function uploadTmage1(data){
  return request({
    url:'/common/batch/uploadImage',
    method:'post',
    data:data
  })
}
